from django.db import models

class Student(models.Model):
    name = models.CharField(max_length=50)
    sex = models.CharField(max_length=50)
    age = models.IntegerField()

class Course(models.Model):
    student = models.OneToOneField(Student, on_delete=models.CASCADE,related_name='course')
    hobby = models.CharField(max_length=50)